{% macro render_field_with_errors(field) %}
      {% if field.name == 'remember' %}
        <input name="remember" type="checkbox" value="Remember Me"> Remember Me
        {% elif field.name == 'password_confirm' %}
        <div class="form-group">
          <input class="form-control" placeholder='{{ field.name }}' name='{{field.name}}' type='password'>
        </div>
      {% else %}
        <div class="form-group">
          <input class="form-control" placeholder='{{ field.name }}' name='{{field.name}}' type='{{field.name}}'>
        </div>
       {% endif %}

    {% if field.errors %}
      <div class="alert alert-danger alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">
              ×
          </button>
          {% for error in field.errors %}
            <li>{{ error }}</li>
          {% endfor %}
      </div>
    {% endif %}
{% endmacro %}

{% macro render_field(field) %}
  <p>{{ field(**kwargs)|safe }}</p>
{% endmacro %}
